﻿@model List<JewererBasic.Models.Product>

@if (Model != null)
{
    var grid = new WebGrid(Model, canSort: true, canPage: true, rowsPerPage: 20);
    grid.Pager(WebGridPagerModes.NextPrevious);
    @grid.GetHtml(tableStyle: "table",
        headerStyle: "head",
        alternatingRowStyle: "altRow",
        selectedRowStyle: "selectRow",
        columns: grid.Columns(
        grid.Column(header: "Production Id", format: @<div style="width: 180px; text-align:center;">@item.Id</div>),
        grid.Column(header: "Kind" ,format: @<div style="width: 100px; text-align:center;">@item.KIND.Name</div>),
        grid.Column(header: "Type" ,format: @<div style="width: 100px; text-align:center;">@item.TYPE.Name</div>),
        grid.Column(header: "Size" ,format: @<div style="width: 100px; text-align:center;">@item.Size</div>),
        grid.Column(header: "Metal Weight" ,format: @<div style="width: 100px; text-align:center;">@item.MetalWeight</div>),
        grid.Column(header: "Total Weight" ,format: @<div style="width: 100px; text-align:center;">@item.TotalWeight</div>),
        grid.Column(header: "Gamma" ,format: @<div style="width: 100px; text-align:center;">@item.GAMMA.Name</div>),
        grid.Column(header: "View Detail", format: @<div style="width: 100px; text-align:center;">@Html.ActionLink("Print", "ExportReportProduct", "Report", new { productId = item.Id }, null)</div>),
        grid.Column(header: "Edit", format: @<div style="width: 100px; text-align:center;">@Html.ActionLink("Edit", "Update", "Product", new { id = item.Id }, null)</div>)
    ));
}